/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edmo.fastener.parser;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Logger;

/**
 *
 * @author Alexx
 */
public abstract class AbstractParser {

    private static Logger log = Logger.getLogger(AbstractParser.class.getName());

    public void readFile(String file) {
        BufferedReader br = null;
        try {
            String sCurrentLine = null;
            br = new BufferedReader(new FileReader(file));
            while ((sCurrentLine = br.readLine()) != null) {
                parse(sCurrentLine);
            }
        } catch (IOException e) {
            log.info(e.toString());
        } finally {
            try {
                if (br != null) {
                    br.close();
                }
            } catch (IOException ex) {
                log.info(ex.toString());
            }
        }
    }

    public abstract void parse(String s);
}
